<template>
  <div class="body">
    <div class="nav">
      <el-menu
          router
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          :ellipsis="false"
          @select="handleSelect"
      >
        <el-menu-item index="/">
          <img
              style="width: 70px;height: 50px"
              src="https://img1.baidu.com/it/u=1745537051,2645681188&fm=253&fmt=auto&app=120&f=JPEG?w=613&h=334"
              alt="Element logo"
          />
        </el-menu-item>
        <div class="flex-grow"/>
        <el-menu-item index="/"> 首页</el-menu-item>
         <el-menu-item index="/user"> 用户管理</el-menu-item>
        <el-menu-item index="/points"> 积分管理</el-menu-item>
        <el-menu-item index="/log"> 账单</el-menu-item>
         <el-menu-item index="/text"> 服务</el-menu-item>

      </el-menu>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>

  </div>
</template>

<script setup>
import {ref} from 'vue'

const activeIndex = ref("/")
const handleSelect = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>


<style scoped>
.flex-grow {
  flex-grow: 1;
}

router-view {
  width: 100%;
  height: 100%;
}

.body {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;

}

.main {
  flex: 1;
  background-color: #f5f6f7;
}
</style>